<template>
    <IDrawer v-model="defaultValue" :loading="loading" :width="860" title="对接设置">
        <Row>
            <BoxCell title="耗材名称">{{data.name}}</BoxCell>
            <BoxCell title="耗材报价">{{data.price}}</BoxCell>
            <BoxCell title="耗材重量">{{data.weight}}</BoxCell>
            <BoxCell title="耗材库存">{{data.stock}}</BoxCell>
            <BoxCell title="耗材备注" :width="4">{{data.remark}}</BoxCell>
        </Row>
        <Tabs value="logs">
            <TabPane label="日志" name="logs">
                <Logs v-model="data.logs"></Logs>
            </TabPane>
            <TabPane label="库存日志"  name="stocks">
                <StockView v-model="data.stocks"></StockView>
            </TabPane>
            <TabPane label="订单消耗" name="orders"></TabPane>
        </Tabs>
        <div slot="footer">
            <Button type="primary" icon="ios-add" @click="submit('formCreate')">提交</Button>
            <Button type="warning" icon="md-log-out" @click="defaultValue = false">返回</Button>
        </div>
    </IDrawer>
</template>

<script>
    import IForm from "../../../components/content/form";
    import contentDrawer from "../../../mixins/contentDrawer";
    import IDrawer from "../../../components/content/drawer";
    import BoxCell from "../../../components/content/boxCell";
    import Logs from "../../../components/content/logs";
    import StockView from "./stockView"
    export default {
        name: "IIView",
        mixins: [contentDrawer],
        components: {Logs, BoxCell, IForm, IDrawer, StockView},
        data() {
            return {
                data:{stocks:[], logs: []}
            }
        },
        mounted(){
            this.getData();
        },
        methods: {
            getData(){
                this.loading = true;
                this.$http.get(`warehouse/package/${this.props.id}`).then((res) => {
                    this.data = res;
                }).finally(() => {
                    this.loading = false;
                });
            }
        }
    }
</script>

<style scoped>

</style>
